package com.maslyk.invitation;

import javax.faces.context.FacesContext;

/**
 *
 * @author kris
 */
public class BeanService
{
    public static Object getApplicationScopeBean(String beanName)
    {
        return FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get(beanName);
    }

    public static void putApplicationScopeBean(String beanName, Object applicationScopeObject)
    {
        FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().put(beanName, applicationScopeObject);
    }

    public static Object getSessionScopeBean(String beanName)
    {
        return FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(beanName);
    }

    public static void putSessionScopeBean(String beanName, Object sessionScopeObject)
    {
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(beanName, sessionScopeObject);
    }

    public static Object getRequestScopeBean(String beanName)
    {
        return FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get(beanName);
    }

    public static void putRequestScopeBean(String beanName, Object requestObject)
    {
        FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(beanName, requestObject);
    }
}

